#include <AT89X52.h>
#define RCLK  P1_5 
#define SDATA P1_6 
#define SCLK  P1_7 

void SendData(unsigned char Xdata,unsigned char Ydata)
{
   unsigned char i=0;
   RCLK=0;
   for(i=0;i<8;i++)
     {
       SDATA=Xdata & 0x01;
       SCLK = 1;
       SCLK = 0;
       Xdata=Xdata>>1;
     }
   for(i=0;i<8;i++)
     {
       SDATA=Ydata & 0x01;
       SCLK = 1;
       SCLK = 0;
       Ydata=Ydata>>1;
     }
   RCLK=1;
}
void Delay()
{
   unsigned int a;
    for(a=50000;a>0;a--)
     {

     }
}
void main(void)
{
  while(1)
    {
        SendData(0x7f,0x01);
	Delay();
        SendData(0xbf,0x01);
	Delay();
	SendData(0xdf,0x01);
	Delay();
	SendData(0xef,0x01);
	Delay();
	SendData(0xf7,0x01);
	Delay();
	SendData(0xfb,0x01);
	Delay();
	SendData(0xfd,0x01);
	Delay();
	SendData(0xfe,0x01);
	Delay();
    }  
}